
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace DTO
{
    public class HinhThucBanDto:IObject
    {
        private int _id;

        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        private HoaDonBanDto _hoaDon;
        public HoaDonBanDto HoaDon
        {
            get { return _hoaDon; }
            set { _hoaDon = value; }
        }

        public DateTime NgayTao
        {
            get { return HoaDon.NgayTao; }
         
        }        
        private Hashtable _duocpham;

        public Hashtable Duocpham
        {
            set { _duocpham = value; }
            get { return _duocpham; }
        }
        private string _tenBenhNhan;

        public string TenBenhNhan
        {
            get { return _tenBenhNhan; }
            set { _tenBenhNhan = value; }
        }
        private string _trieuChung;

        public string TrieuChung
        {
            get { return _trieuChung; }
            set { _trieuChung = value; }
        }
        private BacSiKeToaDto _bacSiKeToa;

        public BacSiKeToaDto BacSiKeToa
        {
            get { return _bacSiKeToa; }
            set { _bacSiKeToa = value; }
        }

        private int _cachBan;

        public int CachBan
        {
            get { return _cachBan; }
            set { _cachBan = value; }
        }

        public DateTime NgayTaoHoaDon
        {
            get
            {
                return HoaDon.NgayTao;
            }
        }
        public string Tenbacsiketoa
        {
            get
            {
                return BacSiKeToa.TenBacSiKeToa;
            }
        }
        
        public string ChitietListDuocpham
        {
            get
            {
                string chitietthuoc = "";
                foreach (DictionaryEntry entry in Duocpham)
                {
                    DuocPhamDto dto = (DuocPhamDto) entry.Value;
                    string tempTenthuoc = "" + dto.TenDuocPham;
                    string tempSoluong = " \t \t  " + dto.SoLuongBan + " " +dto.DonViDuocPham.TenDonVi ;

                    chitietthuoc += tempTenthuoc + " \t " + tempSoluong + "  \r\n";
                }
                return chitietthuoc;
            }
        }
        
        public double ThanhtienHinhthucban
        {
            get
            {
                float thanhtien = 0;
                foreach (DictionaryEntry entry in Duocpham)
                {
                    DuocPhamDto dto = (DuocPhamDto)entry.Value;
                    float tempgiaxuat = dto.GiaXuat;
                    int tempSoluong = dto.SoLuongBan;

                    thanhtien =thanhtien + tempgiaxuat * tempSoluong;
                }
                return thanhtien;
            }
        }
        public float ChitietThanhtienDuocpham
        {
            get
            {
                float thanhtien=0;
                foreach (DictionaryEntry entry in Duocpham)
                {
                    DuocPhamDto dto = (DuocPhamDto)entry.Value;
                    thanhtien += dto.ThanhTien;
                }
                return thanhtien;
            }
        }
    }
}
